#!/bin/sh
[ $(xbps-query -Rs nmap | grep '*' | wc -l) -eq 0 ] && echo "nmap not installed" && exit 1
# possibly use $(iw dev) to test for local network
net="$(ip addr | grep inet | grep -v 127 | grep -v inet6 | awk '{ print $2; exit }')"
nmap -sP "$net"